const { GameServer } = require('board-game');
const { server } = require('./config');

const RunningRole = require('./role');
const RunningBoard = require('./board');
const RunningGame = require('./game');

GameServer.start({
    doAnswer: ({ role, data } ) => role.doAnswer(data),
}, {
    Board: RunningBoard,
    Role: RunningRole,
    Game: RunningGame,
}, server, {
    index: './web/index.js',
    compress: process.env.NODE_ENV !== 'development',
    watch: process.env.NODE_ENV === 'development',
    stats: 'verbose',
    devtools: process.env.NODE_ENV === 'development'
});
